package com.example.demo.service;

import com.example.demo.model.entity.Userinfo;
import com.example.demo.mapper.UserMapper;
import com.example.demo.model.vo.UserinfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:龙宝
 * Date:2024-04-22
 * Time:14:35
 */
@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    //用户名信息
    public Userinfo getUserinfo(String username){
        return userMapper.getUserinfo(username);
    }
    //注册
    public int reg(String username,String password){
        return userMapper.reg(username,password);
    }

    //查询用户信息
    public UserinfoVO getUserByid(Integer id){
        UserinfoVO userinfo = userMapper.getUserByid(id);
        return userinfo;
    }
}
